<template>
  <div class="bg_fff mt_15">
    <div class="flexrowbetween p_20" style="padding-bottom: 12px">
      <span class="f-15 c_000">近7天活动信息</span>
      <span class="c_primary f-14 commhover" @click="goPage(1)">更多</span>
    </div>
    <div style="margin: 0 20px 20px">
      <el-table :data="tableList" class="full_w">
        <el-table-column prop="date" label="状态" width="100">
          <template slot-scope="scope">
            <el-tag
              v-if="scope.row.status == 1"
              type="success"
              class="tag_success"
              >进行中</el-tag
            >
            <el-tag
              v-if="scope.row.status == 4"
              type="warning"
              class="tag_warning"
              >已结束</el-tag
            >
            <el-tag v-if="scope.row.status == 0" type="info" class="tag_info"
              >未发布</el-tag
            >
          </template>
        </el-table-column>
        <el-table-column prop="id" label="活动编号"></el-table-column>
        <el-table-column prop="name" label="活动名称"></el-table-column>
        <el-table-column label="活动时间" width="300">
          <template slot-scope="scope">
            <span
              >{{ scope.row.draw_startime }} -
              {{ scope.row.draw_endtime }}</span
            >
          </template>
        </el-table-column>
        <el-table-column prop="address" width="100" label="创建人">
          <template slot-scope="scope">
            <span>{{ scope.row.member.user_login }}</span>
          </template>
        </el-table-column>
      </el-table>
    </div>

    <div class="line"></div>
    <div class="flexrowbetween p_20" style="padding-bottom: 12px">
      <span class="f-15 c_000">我的活动</span>
      <span class="c_primary f-14 commhover" @click="goPage(2)">更多</span>
    </div>
    <div style="margin: 0 20px 20px">
      <el-table :data="tableList2" class="full_w">
        <el-table-column prop="date" label="状态"  width="100">
          <template slot-scope="scope">
            <el-tag
              v-if="scope.row.status == 1"
              type="success"
              class="tag_success"
              >进行中</el-tag
            >
            <el-tag
              v-if="scope.row.status == 4"
              type="warning"
              class="tag_warning"
              >已结束</el-tag
            >
            <el-tag v-if="scope.row.status == 0" type="info" class="tag_info"
              >未发布</el-tag
            >
          </template>
        </el-table-column>
        <el-table-column prop="id" label="活动编号"></el-table-column>
        <el-table-column prop="name" label="活动名称"></el-table-column>
        <el-table-column label="活动时间" width="300">
          <template slot-scope="scope">
            <span
              >{{ scope.row.draw_startime }} -
              {{ scope.row.draw_endtime }}</span
            >
          </template>
        </el-table-column>
        <el-table-column prop="address" width="100" label="创建人">
          <template slot-scope="scope">
            <span>{{ scope.row.member.user_login }}</span>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import { taskDay, myTaskDay } from "@/api/home";
export default {
  data() {
    return {
      tableList: [],
      tableList2: [],
    };
  },
  props: {
    sevenData: {
      type: Array,
      default: () => [],
    },
  },
  created() {
    this.getTaskDay();
    this.getMyTaskDay();
  },
  methods: {
    getTaskDay() {
      taskDay().then((res) => {
        this.tableList = res.data;
      });
    },

    getMyTaskDay() {
      myTaskDay().then((res) => {
        this.tableList2 = res.data;
      });
    },

    goPage(type){
    // if()
      this.$router.push({name:"adminactionaclist"})
    }
  },
};
</script>

<style lang="scss" scoped>
.line {
  width: 100%;
  height: 1px;
  background-color: #dedede;
}
</style>